package org.skyeye.modeling.tools;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.gef.requests.CreationFactory;
import org.eclipse.gef.requests.SimpleFactory;
import org.skyeye.modeling.model.Attribute;
import org.skyeye.modeling.model.MDevice;
import org.skyeye.modeling.model.MSOC;

public class SOCFactory extends SimpleFactory {
	public String deviceName = "deviceName"+System.currentTimeMillis();
	public String baseType = "";
	public String className ="";
	public List<Attribute> attrList = new ArrayList<Attribute>();
	

	public SOCFactory(Class aClass, String deviceName, String baseType, String className, List<Attribute> attrList) {
		super(aClass);
		this.deviceName = deviceName;
		this.baseType = baseType;
		this.className = className;
		this.attrList = attrList;
	}
	
	@Override
	public Object getNewObject() {
		MSOC newSoc = (MSOC) super.getNewObject();
		System.out.println("DeviceFactory getNewObject: "+this.deviceName);
		newSoc.setBaseName(deviceName);
		newSoc.setBaseType(baseType);
		newSoc.setClassName(className);
		newSoc.setAttrList(attrList);
		return newSoc;
	}

	
}
